package com.jjwxc.jwjskandriod.activity;

import android.view.View;
import android.widget.Switch;

import com.jjwxc.jwjskandriod.R;
import com.jjwxc.jwjskandriod.config.BaseActivity;
import com.jjwxc.jwjskandriod.framework.utils.PreUtils;

public class ManagePushActivity extends BaseActivity {
    Switch sw_switch;

    @Override
    public int getContentViewId() {
        return R.layout.activity_managepush;
    }

    @Override
    public void findView() {
        setTitle("了解与管理个性化推送");

        sw_switch = findViewById(R.id.sw_switch);
    }

    @Override
    public void setListener() {
        sw_switch.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (PreUtils.getBoolean("wuyong", false)) {
                    PreUtils.setBoolean("wuyong", false);
                } else {
                    PreUtils.setBoolean("wuyong", true);
                }
            }
        });
    }

    @Override
    public void afterCreate() {
        sw_switch.setChecked(PreUtils.getBoolean("wuyong", false));
    }
}
